From 7229bad40802e7591066ba291786a05da8afe328 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 18 May 2005 16:59:25 +0000 Subject: [PATCH] bitkeeper revision 1.1159.258.137 (428b746dvt7HoFn2rjyGGO-i1yesPg) Ensure that domain0 console receiver does not get stuck if serial input is received early during boot. Fixes bugzilla bug #41. Signed-off-by: Keir Fraser --- xen/drivers/char/console.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index ba4c53f927..f4864f5744 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -260,15 +260,13 @@ static void switch_serial_input(void) static void __serial_rx(unsigned char c, struct xen_regs *regs) { if ( xen_rx ) - { - handle_keypress(c, regs); - } - else if ( (serial_rx_prod-serial_rx_cons) != SERIAL_RX_SIZE ) - { - serial_rx_ring[SERIAL_RX_MASK(serial_rx_prod)] = c; - if ( serial_rx_prod++ == serial_rx_cons ) - send_guest_virq(dom0, VIRQ_CONSOLE); - } + return handle_keypress(c, regs); + + /* Deliver input to guest buffer, unless it is already full. */ + if ( (serial_rx_prod-serial_rx_cons) != SERIAL_RX_SIZE ) + serial_rx_ring[SERIAL_RX_MASK(serial_rx_prod++)] = c; + /* Always notify the guest: prevents receive path from getting stuck. */ + send_guest_virq(dom0, VIRQ_CONSOLE); } static void serial_rx(unsigned char c, struct xen_regs *regs) -- 2.30.2